<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<!-- Meta, title, CSS, favicons, etc. -->
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content="Bootstrap - 简洁、直观、强悍、移动设备优先的前端开发框架，让web开发更迅速、简单。">
		<meta name="keywords" content="HTML, CSS, JS, JavaScript, framework, bootstrap, front-end, frontend, web development">
		<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
		<meta name="author" content="yangweijie <917647288@qq.com>">
		<title>《跟老杨学ThinkPHP》随书示列</title>
		<!-- Bootstrap core CSS -->
		<link href="Public/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
		<!-- Optional Bootstrap Theme -->
		<link href="data:text/css;charset=utf-8," data-href="Public/bower_components/bootstrap/dist/css/bootstrap-theme.min.css" rel="stylesheet" id="bs-theme-stylesheet">
		<link rel="stylesheet" href="Public/highlight/default.css">
		<script type="text/javascript" src="Public/highlight/highlight.pack.js"></script>
		<!-- Documentation extras -->
		<link href="Public/css/docs.min.css" rel="stylesheet">
		<link href="Public/css/patch.css" rel="stylesheet">
		<!--[if lt IE 9]><script src="Public/js/ie8-responsive-file-warning.js"></script><![endif]-->
		<script src="Public/js/ie-emulation-modes-warning.js"></script>
		<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
		<!--[if lt IE 9]>
		  <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
		  <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
		<!-- Favicons -->
		<link rel="apple-touch-icon" href="Public/img/apple-touch-icon.png">
		<link rel="icon" href="/favicon.ico">
		<style type="text/css">
			[role="tabpanel"]{
				max-height: 400px;
				margin-bottom: 51px;
			}

			.tab-pane{
				overflow-y:scroll;
			}

		</style>
	</head>
	<body>
		<a id="skippy" class="sr-only sr-only-focusable" href="#content"><div class="container"><span class="skiplink-text">Skip to main content</span></div></a>
		<!-- Docs page layout -->
		<div class="container bs-docs-container">
			<div class="row">
				<div class="col-md-9" role="main" id="examples">
					<div class="bs-docs-section">
						<h1 id="tp-overview">概述</h1>
						<p>本示列，基于ThinkPHP3.2.3版和bootstrap3、jquery完成，用于展示一些tp的用法。</p>
					</div>
					<div class="bs-docs-section">
						<h1 id="tp-basic">基础知识</h1>
						<p>展示了一些常用的tp概念使用。</p>
						<h2 id="startup">起步(1)</h2>
						<div role="tabpanel">
							<!-- Nav tabs -->
							<ul class="nav nav-tabs" role="tablist">
								<li role="presentation" class="active"><a href="#startup_home" aria-controls="home" role="tab" data-toggle="tab">效果</a></li>
								<li role="presentation"><a href="#startup_code" aria-controls="startup_code" role="tab" data-toggle="tab">关键代码</a></li>
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div role="tabpanel" class="tab-pane active" id="startup_home">
								<iframe src="startup/index.php" frameborder="0" height="300" width="100%"></iframe>
								</div>
								<div role="tabpanel" class="tab-pane" id="startup_code" data-ajax="startup/index.php/Doc/example/id/startup">
								</div>
							</div>
						</div>
						<h2 id="startup_2">起步(2)</h2>
						<div role="tabpanel">
							<!-- Nav tabs -->
							<ul class="nav nav-tabs" role="tablist">
								<li role="presentation" class="active"><a href="#startup_2_home" aria-controls="home" role="tab" data-toggle="tab">效果</a></li>
								<li role="presentation"><a href="#startup_2_code" aria-controls="startup_2_code" role="tab" data-toggle="tab">关键代码</a></li>
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div role="tabpanel" class="tab-pane active" id="startup_2_home">
								<iframe src="startup/index.php/Index/tags" frameborder="0" height="400" width="100%"></iframe>
								</div>
								<div role="tabpanel" class="tab-pane" id="startup_2_code" data-ajax="startup/index.php/Doc/example/id/startup_tags">
								</div>
							</div>
						</div>
						<h2 id="controller">控制器(1)</h2>
						<div role="tabpanel">
							<!-- Nav tabs -->
							<ul class="nav nav-tabs" role="tablist">
								<li role="presentation" class="active"><a href="#controller_home" aria-controls="home" role="tab" data-toggle="tab">效果</a></li>
								<li role="presentation"><a href="#controller_code" aria-controls="controller_code" role="tab" data-toggle="tab">关键代码</a></li>
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div role="tabpanel" class="tab-pane active" id="controller_home">
								<iframe src="startup/index.php/Hello/hello" frameborder="0" height="100" width="100%"></iframe>
								</div>
								<div role="tabpanel" class="tab-pane" id="controller_code" data-ajax="startup/index.php/Doc/example/id/controller_home">
								</div>
							</div>
						</div>
						<h2 id="controller_2">控制器(2)-前置后置</h2>
						<div role="tabpanel">
							<!-- Nav tabs -->
							<ul class="nav nav-tabs" role="tablist">
								<li role="presentation" class="active"><a href="#controller_2_home" aria-controls="home" role="tab" data-toggle="tab">效果</a></li>
								<li role="presentation"><a href="#controller_2_code" aria-controls="controller_2_code" role="tab" data-toggle="tab">关键代码</a></li>
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div role="tabpanel" class="tab-pane active" id="controller_2_home">
								<iframe src="startup/index.php/Hello/index" frameborder="0" height="100" width="100%"></iframe>
								</div>
								<div role="tabpanel" class="tab-pane" id="controller_2_code">
									<section>/Applications/XAMPP/xamppfiles/htdocs/git/yang_book/examples/startup/Home/Controller/HelloController.class.php</section>
									<pre class="pre-scrollable">
//前置操作
public function _before_index(){
	echo 'before<br/>';
}
public function index(){
	echo 'index<br/>';
}
//后置操作方法
public function _after_index(){
	echo 'after<br/>';
}
									</pre>
								</div>
							</div>
						</div>
						<h2 id="model">模型</h2>
						<div role="tabpanel">
							<!-- Nav tabs -->
							<ul class="nav nav-tabs" role="tablist">
								<li role="presentation" class="active"><a href="#model_home" aria-controls="home" role="tab" data-toggle="tab">效果</a></li>
								<li role="presentation"><a href="#model_code" aria-controls="model_code" role="tab" data-toggle="tab">关键代码</a></li>
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div role="tabpanel" class="tab-pane active" id="model_home">
								<iframe src="startup/index.php/Model/index" frameborder="0" height="700" width="100%"></iframe>
								</div>
								<div role="tabpanel" class="tab-pane" id="model_code" data-ajax="startup/index.php/Doc/example/id/model">
								</div>
							</div>
						</div>

						<h2 id="adv_model">高级模型</h2>
						<div role="tabpanel">
							<!-- Nav tabs -->
							<ul class="nav nav-tabs" role="tablist">
								<li role="presentation" class="active"><a href="#adv_model_home" aria-controls="home" role="tab" data-toggle="tab">效果</a></li>
								<li role="presentation"><a href="#adv_model_code" aria-controls="adv_model_code" role="tab" data-toggle="tab">关键代码</a></li>
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div role="tabpanel" class="tab-pane active" id="adv_model_home">
								<iframe src="startup/index.php/Advmodel/index" frameborder="0" height="1000" width="100%"></iframe>
								</div>
								<div role="tabpanel" class="tab-pane" id="adv_model_code" data-ajax="startup/index.php/Doc/example/id/adv_model">
								</div>
							</div>
						</div>

						<h2 id="template">模板</h2>
						<div role="tabpanel">
							<!-- Nav tabs -->
							<ul class="nav nav-tabs" role="tablist">
								<li role="presentation" class="active"><a href="#template_home" aria-controls="home" role="tab" data-toggle="tab">效果</a></li>
								<li role="presentation"><a href="#template_code" aria-controls="template_code" role="tab" data-toggle="tab">关键代码</a></li>
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div role="tabpanel" class="tab-pane active" id="template_home">
								<iframe src="startup/index.php/Template/index" frameborder="0" height="700" width="100%"></iframe>
								</div>
								<div role="tabpanel" class="tab-pane" id="template_code" data-ajax="startup/index.php/Doc/example/id/template">
								</div>
							</div>
						</div>

						<h2 id="auth_auth">权限-auth</h2>
						<div role="tabpanel">
							<!-- Nav tabs -->
							<ul class="nav nav-tabs" role="tablist">
								<li role="presentation" class="active"><a href="#auth_auth_home" aria-controls="home" role="tab" data-toggle="tab">效果</a></li>
								<li role="presentation"><a href="#auth_auth_code" aria-controls="auth_auth_code" role="tab" data-toggle="tab">关键代码</a></li>
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div role="tabpanel" class="tab-pane active" id="auth_auth_home">
								<iframe src="auth/index.php/Admin/Index/index" frameborder="0" height="500" width="100%"></iframe>
								</div>
								<div role="tabpanel" class="tab-pane" id="auth_auth_code">
									<section>yang_book/examples/auth</section>
									<pre class="pre-scrollable">参见项目代码  admin:admin</pre>
									<section><a href="auth/index.php/Admin/Index/index" target="_blank">新窗打开</a></section>
								</div>
							</div>
						</div>
						<h2 id="auth_rbac">权限-rbac</h2>
						<div role="tabpanel">
							<!-- Nav tabs -->
							<ul class="nav nav-tabs" role="tablist">
								<li role="presentation" class="active"><a href="#rbac_rbac_home" aria-controls="home" role="tab" data-toggle="tab">效果</a></li>
								<li role="presentation"><a href="#rbac_rbac_code" aria-controls="rbac_rbac_code" role="tab" data-toggle="tab">关键代码</a></li>
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div role="tabpanel" class="tab-pane active" id="rbac_rbac_home">
								<iframe src="rbac" frameborder="0" height="500" width="100%"></iframe>
								</div>
								<div role="tabpanel" class="tab-pane" id="rbac_rbac_code">
									<section>yang_book/examples/auth</section>
									<pre class="pre-scrollable">参见项目代码  admin:admin</pre>
									<section><a href="rbac" target="_blank">新窗打开</a></section>
								</div>
							</div>
						</div>
						<h2 id="safe">安全</h2>
						<div role="tabpanel">
							<!-- Nav tabs -->
							<ul class="nav nav-tabs" role="tablist">
								<li role="presentation" class="active"><a href="#safe_home" aria-controls="home" role="tab" data-toggle="tab">效果</a></li>
								<li role="presentation"><a href="#safe_code" aria-controls="safe_code" role="tab" data-toggle="tab">关键代码</a></li>
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div role="tabpanel" class="tab-pane active" id="safe_home">
								<iframe src="safe" frameborder="0" height="500" width="100%" id="iframe_safe"></iframe>
								</div>
								<div role="tabpanel" class="tab-pane" id="safe_code">
									<section>yang_book/examples/safe</section>
									<pre class="pre-scrollable">参见项目代码  admin:admin</pre>
									<section><a href="safe" target="_blank">新窗打开</a></section>
								</div>
							</div>
						</div>
					</div>
				</div>

				<div class="col-md-3" role="complementary">
					<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm">
						<ul class="nav bs-docs-sidenav">
							<li class="">
								<a href="#tp-overview">概览</a>
							</li>
							<li class="">
								<a href="#tp-basic">基础知识</a>
								<ul class="nav">
									<li class=""><a href="#startup">起步（1）</a></li>
									<li class=""><a href="#startup_2">起步（2）</a></li>
									<li class=""><a href="#controller">控制器（1）</a></li>
									<li class=""><a href="#controller_2">控制器（2）</a></li>
									<li class=""><a href="#model">模型</a></li>
									<li class=""><a href="#adv_model">高级模型</a></li>
									<li class=""><a href="#template">模板</a></li>
								</ul>
							</li>
							<li class="">
								<a href="#tp-higher">进阶知识</a>
								<ul class="nav">
									<li class=""><a href="#router">路由</a></li>
									<li class=""><a href="#config">配置</a></li>
									<li class=""><a href="#cache">缓存</a></li>
									<li class=""><a href="#auth_auth">权限-auth</a></li>
									<li class=""><a href="#auth_rbac">权限-rbac</a></li>
									<li class=""><a href="#extend">扩展</a></li>
									<li class=""><a href="#in18">国际化</a></li>
									<li class=""><a href="#safe">安全</a></li>
									<li class=""><a href="#phpunit">单元测试</a></li>
								</ul>
							</li>
						</ul>
						<a class="back-to-top" href="#top">
							返回顶部
						</a>
					</nav>
				</div>

			</div>
		</div>

		<!-- Footer================================================== -->
		<footer class="bs-docs-footer" role="contentinfo">
			<div class="container">
				<p>Designed and built with all the love in the world by <a href="https://twitter.com/mdo" target="_blank">@mdo</a> and <a href="https://twitter.com/fat" target="_blank">@fat</a>.</p>
				<p>Maintained by the <a href="https://github.com/orgs/twbs/people">core team</a> with the help of <a href="https://github.com/twbs/bootstrap/graphs/contributors">our contributors</a>.</p>
				<p>本项目源码受 <a rel="license" href="https://github.com/twbs/bootstrap/blob/master/LICENSE" target="_blank">MIT</a>开源协议保护，文档受 <a rel="license" href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a> 开源协议保护。</p>
			</div>
		</footer>

		<!-- Bootstrap core JavaScript
		================================================== -->
		<!-- Placed at the end of the document so the pages load faster -->
		<script src="Public/bower_components/jquery/dist/jquery.min.js"></script>
		<script src="Public/js/docs.min.js"></script>
		<script src="Public/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

		<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
		<script src="Public/js/ie10-viewport-bug-workaround.js"></script>
		<script type="text/javascript">
			$(function(){
				ZeroClipboard.config({moviePath: "Public/ZeroClipboard.swf",hoverClass: "btn-clipboard-hover"});
				//tab ajax实现
				$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
					var $target = $($(e.target).attr('href'));
					var url = $target.data('ajax');
					$target.load(url,{}, function(){
						$target.find('pre').each(function(i, block) {
							// var b = '<div class="zero-clipboard"><span class="btn-clipboard">复制</span></div>';
       //      				$(block).before(b)
							// var d = new ZeroClipboard($(".btn-clipboard")), e = $("#global-zeroclipboard-html-bridge");
					  //       d.on("load", function() {
					  //           e.data("placement", "top").attr("title", "复制到剪贴板").tooltip()
					  //       }), d.on("dataRequested", function(b) {
					  //           var c = $(this).parent().nextAll(".highlight").first();
					  //           b.setText(c.text())
					  //       }), d.on("complete", function() {
					  //           e.attr("title", "完成复制！").tooltip("fixTitle").tooltip("show").attr("title", "复制到剪贴板").tooltip("fixTitle")
					  //       }), d.on("noflash wrongflash", function() {
					  //           e.attr("title", "您的浏览器需要安装 Flash 插件").tooltip("fixTitle").tooltip("show")
					  //       })
							hljs.highlightBlock(block);
							//复制无效啊
						});
					});
					console.log(e.relatedTarget);
				});
				//未实现的导航添加尚未实现title和disable类，并且解除click事件
				$('.bs-docs-sidenav li a').each(function(index, el) {
					var $this = $(el);
					var targetId = $this.attr('href');
					var blackList = ['#tp-higher', '#tp-basic'];
					if(!$(targetId).length && blackList.indexOf(targetId) == -1){
						$this.addClass('disabled');
						$this.on('click', function(){
							return false;
						});
						options = {
							title: '尚未实现，欢迎投稿补充',
							placement: 'left'
						};
						$this.tooltip(options);
					}
				});
			});
		</script>
	</body>
</html>